<template>
    <div>
<uni-popup ref="popup" type='bottom' >
<view class="AddBuy_content">
 <uni-icons
 @click.native="$refs.popup.close()"
 class="closeIcon"
     custom-prefix="iconfont" type="icon-cuowu" 
    size="20"
 />
 <view class="top">
  <img :src="imgUrl" >
  <view class="price" :style="{color:themeColor}">
    ￥<span style="fontSize:48rpx">3.99</span>
    <view  class="stock">库存：955 </view>
  </view>
  
 </view>
  <view class="count">
    <view>数量</view>
    <uni-number-box :min='1' :max='11' @change="changeCount"></uni-number-box>
  </view>
  <view class="buttonWrap">
     <div class="btn">立即购买</div>
  </view>
</view>
</uni-popup>
    </div>
</template>

<script>
// 库存
    export default {
     props: {
        imgUrl: {
            type: String,
            required:true
        },
        themeColor:{
          type:String,
          default:'#fe560a'
        }
     },
        methods: {
         open(){
            this.$refs.popup.open()
         },
         changeCount(e){
            console.log(e)
         }
        }
    }
</script>

<style lang="scss" scoped>
.AddBuy_content{
    height: 480rpx;
    background-color: #fff;
    border-radius: 25rpx 25rpx 0 0;
    position: relative;
    .closeIcon{
        position: absolute;
        right: 50rpx;
        top: 50rpx;
    }
    .top{
        padding: 30rpx 24rpx;
        display: flex;
        img{
            width: 180rpx;
            height: 180rpx;
        }
        .price{
            font-size: 24rpx;
          padding: 50rpx 34rpx 10rpx 28rpx;
          .stock{
            // padding-top: ;
            color: #525252;
          }
        }
    }
    .count{
           padding: 30rpx 24rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .buttonWrap{
        height: 80rpx;
        padding: 0 26rpx;
        margin-top: 10rpx;
    .btn{
        width: 100%;
        height: 100%;
        background:#fe560a;
        border-radius: 40rpx;
        color: #fff;
        text-align: center;
        line-height: 80rpx;
    }
    }
}
</style>